package at.technikum.fotoalbum.beans;

public class SessionBean {
	

	private boolean isLoggedIn = false;
	private String nick;
	private boolean isAdmin = false;
	private String registernick;
	
	
	public String getRegisternick() {
		return registernick;
	}
	public void setRegisternick(String registernick) {
		this.registernick = registernick;
	}
	public boolean isLoggedIn() {
		return isLoggedIn;
	}
	public void setLoggedIn(boolean isLoggedIn) {
		if(isLoggedIn == false){
			this.isAdmin = false;
		}
		this.isLoggedIn = isLoggedIn;
	}
	public String getNick() {
		return nick;
	}
	public void setNick(String nick) {
		this.nick = nick;
	}
	public boolean getIsAdmin() {
		return isAdmin;
	}
	public void setIsAdmin(boolean isAdmin) {
		this.isAdmin = isAdmin;
	}
    
    public String doLogout(){
    	this.isLoggedIn = false;
    	this.isAdmin = false;
    	return "/pages/mainpage.xhtml";
    }

}
